checkLogin();

scorllInit();

var aa = getCache(login_key);
console.log(aa)

fenye_options.url = water_bill_list;
fenye_options.dataName = 'goods_list';
fenye_options.callback = function(res){
    //先解绑事件，防止上拉加载造成二次绑定，导致事件被执行多次
    $(".buy-ticket").unbind('click');
    //绑定点击事件，跳转页面

    mui('.bill-price').on('tap', '.buy-ticket', function () {
        var sPrents = $(this).parents(".ticket_id");
        var goods_id = sPrents.attr('id');
        redirect('water-buy-ticket.html?id='+goods_id);
    });

    //点击更换页面
    $('.mui-control-item').on('tap',function () {
        var data =   parseInt(this.getAttribute('data'));
        if(data == 1){
            $('#itemtext').hide();
            $('#itemlist').show();
        }else {
            $('#itemtext').show();
            $('#itemlist').hide();
        }
    })
};

//获取水票须知
var success = function (res) {
    var info = res.data.info;
    console.log(info)
    $('#detail_know').append(info.bill_notice);



    
}
getData(shop_info,comParams(),success);




function scorllInit() {
    var info = getScreen();
    var category_height = parseInt($("#segmentedControl").height());
    var bar_height = parseInt($(".mui-bar").height());
    var scroll_height = info[1] - category_height - bar_height + 'px';
    fenye_options.scrollHeight = scroll_height; //设置分页滚轴高度（自适应）
    mui('.mui-control-content').each(function() {
        this.style.height = scroll_height;
    });
    mui('.mui-scroll-wrapper').each(function(k, v) {
        mui(v).scroll({
            deceleration: (mui.os.ios ? 0.003 : 0.0006),
            indicators: false  //隐藏一条滚动条 增大减速系数。。。
        });
    });
}


